﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;

/// <summary>
/// Summary description for CommonConnection
/// </summary>
public class CommonConnection
{

    private static CommonConnection instance;


    public static CommonConnection Instance()
    {
        // Use 'Lazy initialization' 
        if (instance == null)
        {
            instance = new CommonConnection();
        }

        return instance;
    }
    
    
    private MySqlConnection connection;




    public void CreateConnection()
    {
        string MyConString = "SERVER=dbmy0044.whservidor.com;" +
                  "DATABASE=ploobs_9;" +
                  "UID=ploobs_9;" +
                  "PASSWORD=number2square;";
        connection = new MySqlConnection(MyConString);    
    }


    public void executeSQL(string sql)
    {

        MySqlCommand cmd = new MySqlCommand();
        cmd.CommandText = sql;
        cmd.Connection = connection;
        connection.Open();
        int aff = cmd.ExecuteNonQuery();
        connection.Close();

    }
    
    protected CommonConnection() { }


	


}



